from redis import StrictRedis

REDIS_HOST = '127.0.0.1'
REDIS_PORT = 6379


class Config(object):
    DEBUG = None

    # secret_key manage
    SECRET_KEY = 'N76yrPWSAFUA5HCo5CMiCM60O+obsPTadJriMSgY5zIOJacEt2MO9V2rW9PbUqhQXpw='

    # redis manage
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    PERMANENT_SESSION_LIFETIME = 86400

    # mysql manage
    # 链接数据库
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/information'
    # 动态追踪修改设置，如未设置只会提示警告
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # 查询时会显示原始SQL语句
    SQLALCHEMY_ECHO = False


class DevelopmentConfig(Config):
    DEBUG = True


class ProductionConfig(Config):
    DEBUG = False


config_dict = {
    'development': DevelopmentConfig,
    'production': ProductionConfig
}

# import os, base64
#
# a = os.urandom(50)
# print(base64.b64encode(a))
